namespace Terra.Core.Configuration.Options
{
    /// <summary>
    /// 邮件配置
    /// </summary>
    public class EmailSettings
    {
        /// <summary>
        /// SMTP服务器地址
        /// </summary>
        public string SmtpServer { get; set; } = "";

        /// <summary>
        /// SMTP端口
        /// </summary>
        public int SmtpPort { get; set; } = 587;

        /// <summary>
        /// 是否启用SSL
        /// </summary>
        public bool EnableSsl { get; set; } = true;

        /// <summary>
        /// 发件人邮箱
        /// </summary>
        public string FromEmail { get; set; } = "";

        /// <summary>
        /// 发件人显示名称
        /// </summary>
        public string FromName { get; set; } = "";

        /// <summary>
        /// 用户名
        /// </summary>
        public string Username { get; set; } = "";

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; } = "";

        /// <summary>
        /// 重试次数
        /// </summary>
        public int RetryCount { get; set; } = 3;

        /// <summary>
        /// 重试间隔(秒)
        /// </summary>
        public int RetryInterval { get; set; } = 5;

        /// <summary>
        /// 邮件模板配置
        /// </summary>
        public EmailTemplateSettings Template { get; set; } = new();
    }

    /// <summary>
    /// 邮件模板配置
    /// </summary>
    public class EmailTemplateSettings
    {
        /// <summary>
        /// 模板路径
        /// </summary>
        public string TemplatePath { get; set; } = "Templates/Email";

        /// <summary>
        /// 是否缓存模板
        /// </summary>
        public bool CacheTemplates { get; set; } = true;

        /// <summary>
        /// 默认布局模板名称
        /// </summary>
        public string DefaultLayout { get; set; } = "_Layout";

        /// <summary>
        /// 模板文件扩展名
        /// </summary>
        public string TemplateExtension { get; set; } = ".html";
    }
}